﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="ListProduct.aspx.cs" Inherits="ProjectSem3.Admin.WebForm6" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentTabs" runat="server">
<ul>
    <li><a href="ListProduct.aspx" class="current"><span>List</span></a></li>
    <li><a href="AddNewProduct.aspx"><span>New product</span></a></li>
</ul>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="contentPage" runat="server">
 <div class="grid_9">
        <h1 class="dashboard">
           List products
        </h1>
    </div>
    <asp:ListView runat="server" ID="listView1" 
            onpagepropertieschanged="listView1_PagePropertiesChanged" 
        onpagepropertieschanging="listView1_PagePropertiesChanging">
        <LayoutTemplate>
            <div class="portlet">
                <div class="portlet-content nopadding">
                    <table width="100%" cellpadding="0" cellspacing="0" id="box-table-a" summary="Employee Pay Sheet">
                        <thead>
                            <tr>
                                <th>
                                    Product name
                                </th>
                                <th>
                                    Supplier
                                </th>
                                <th>
                                    Category
                                </th>
                                <th>
                                    Price
                                </th>
                                <th>
                                    Warranty
                                </th>
                                <th>
                                    Status
                                </th>
                                <th>
                                    View
                                </th>
                                     <th>
                                    Option
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
                        </tbody>
                    </table>
                </div>
            </div>
        </LayoutTemplate>
        <ItemTemplate>
            <tr>
                <td>
                    <%# Eval("Name") %>
                      <asp:HiddenField ID="HiddenField1" runat="server"  Value='<%# Eval("ProductID") %>' />
                </td>
                <td>
                    <%# Eval("Supplier.Name")%>
                </td>
                <td>
                    <%# Eval("Category.Name")%>
                </td>
                <td>
                    <%# Eval("Price")%>
                </td>
                <td>
                    <%# Eval("Warranty")%>
                </td>
                <td>
                   <asp:CheckBox Checked='<%# Eval("Status")%>' runat="server" Enabled="false"/>
                </td>
                <td>
                    <%# Eval("View")%>
                </td>
                     <td>
                         <a href='<%# "EditProduct.aspx?id=" + Eval("ProductID") %>' runat="server">Edit</a>
                      
                </td>
            </tr>
        </ItemTemplate>
    </asp:ListView>
     <asp:DataPager ID="DataPager1" runat="server" PageSize="8" PagedControlID="ListView1">
        <Fields>
            <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowPreviousPageButton="true"
                ButtonType="Link" ShowNextPageButton="false" ShowLastPageButton="false" />
            <asp:NumericPagerField ButtonType="Link" />
            <asp:NextPreviousPagerField ShowFirstPageButton="false" ButtonType="Link" ShowPreviousPageButton="false"
                ShowNextPageButton="true" ShowLastPageButton="true" />
        </Fields>
    </asp:DataPager>
</asp:Content>
